import request from '@/utils/request'

// 查询邮件列表 - 分页
export function emailPages(query) {
    return request({
        url: '/as/asMailUser',
        method: 'get',
        params: query
    })
}

// 发送邮件
export function createEmail(data) {
    return request({
        url: '/as/asMail',
        method: 'post',
        data: data
    })
}

// 编辑邮件
export function editEmail(data) {
    return request({
        url: '/as/asMail',
        method: 'put',
        data: data
    })
}

// 删除邮件
export function removeEmail(query) {
    return request({
        url: '/as/asMail',
        method: 'delete',
        params: query
    })
}

// 阅读邮件详情
export function readEmailDetail(data) {
    return request({
        url: '/as/asMailUser/readMail',
        method: 'post',
        data: data
    })
}

// 删除邮件
export function removeEmails(data) {
    return request({
        url: '/as/asMail/removeMail',
        method: 'post',
        data: data
    })
}

// 批量已读
export function readEamils(data) {
    return request({
        url: '/as/asMail/readMailList',
        method: 'post',
        data: data
    })
}

// 批量已读
export function tabsStatistics(query) {
    return request({
        url: '/as/asMailUser/selectCount',
        method: 'get',
        params: query
    })
}

// 恢复已删除邮件
export function recoverEmail(data) {
    return request({
        url: '/as/asMail/returnMailStatus',
        method: 'post',
        data: data
    })
}

// 全局消息列表 - 分页
export function messagePages(query) {
    return request({
        url: '/oms/sysMessage',
        method: 'get',
        params: query
    })
}

// 获取消息数量
export function messageCount(query) {
    return request({
        url: '/oms/sysMessage/getMessageCount',
        method: 'get',
        params: query
    })
}

// 消息已读
export function readMessage(data) {
    return request({
        url: '/oms/sysMessage/readMessage',
        method: 'post',
        data: data
    })
}

